package sample.methodframe;

import java.util.Random;

class HelloWorld {
    public HelloWorld() {
        super();
    }

    public static void main(String[] args) {
        HelloWorld instance = new HelloWorld();
        boolean flag = instance.getFlag();
        instance.test(flag);
    }

    public boolean getFlag() {
        Random rand = new Random();
        return rand.nextBoolean();
    }

    public void test(boolean flag) {
        if (flag) {
            System.out.println("value is true");
        } else {
            System.out.println("value is false");
        }
    }
}
